package com.csj.mvvm.api

import com.csj.mvvm.api.retrofit.RetrofitClient2

class HttpUtil2 : HttpUtil() {

    companion object {
        @Volatile
        private var httpUtil: HttpUtil2? = null

        fun getInstance() = httpUtil ?: synchronized(this) {
            httpUtil ?: HttpUtil2().also { httpUtil = it }
        }
    }

    private var mService = RetrofitClient2.getInstance().create()

    //可以直接在BaseViewModel中获取取ApiService对象，简化接口调用
    override fun getService(): ApiService {
        return mService
    }

}
